home *** CD-ROM | disk | FTP | other *** search
- (********************************************************************
-
- :Program. spObjects.mod
- :Contents. interface module for superplay objects
- :Copyright. © 1994 by Andreas R. Kleinert
- :Language. Oberon-2
- :Translator. A+L Amiga Oberon Compiler V3.11d
- :History. V2.1 indy 25-Dec-95 first translation of c include
- :History. V2.2 indy 05-Jul-96 update: c include V2.2(21.10.1995)
- :History. V5.1 indy 07-Jan-96 update: c include V5.1(08.08.1996)
- *********************************************************************)
-
- MODULE spObjects;
-
- (*
- $VER: spObjects 5.1 (07.01.96)
-
- This Oberon-2 interface module contains the c-includes:
- -------------------------------------------------------
- spobjects/spobjectbase.h
- Version : 5.1
- Date : 8.8.1996
- Written by : Andreas R. Kleinert
-
- spobjects/spobjects.h
- Version : 5.1
- Date : 8.8.1996
- Written by : Andreas R. Kleinert
- *)
-
-
- IMPORT
- e *: Exec;
- (*****************************************************************************)
-
-
- TYPE
- SPObjectBasePtr * = UNTRACED POINTER TO SPObjectBase;
- ObjectNodePtr * = UNTRACED POINTER TO ObjectNode;
- SampleListPtr * = UNTRACED POINTER TO SampleList;
- SampleEntryPtr * = UNTRACED POINTER TO SampleEntry;
- CheckFilePtr * = UNTRACED POINTER TO CheckFile;
-
-
- ObjectNode * = STRUCT(node *: e.Node) (* chaining Node *)
-
- version * : LONGINT; (* Library-Version of spobject *)
-
- objectType * : LONGINT; (* see below *)
-
- fileName * : ARRAY 108 OF CHAR; (* use 30, as in struct FileInfoBlock *)
-
- typeID * : ARRAY 32 OF CHAR; (* e.g. "MED" *)
- typeCode * : LONGINT; (* ... and its appropriate Code, , *)
- (* assigned by superplay.library LATER. *)
-
- subTypeNum * : LONGINT; (* actually available SubTypes *)
- (* (maximum 16) of the spobject. *)
-
- subTypeID * : ARRAY 16, 16 OF CHAR; (* e.g. "MMD0" or "MMD1" *)
- subTypeCode * : ARRAY 16 OF LONGINT; (* ... and their appropriate Codes, *)
- (* assigned by superplay.library LATER. *)
-
- backgroundReplay * : LONGINT; (* Runs in the Background ? (Boolean) *)
-
- (* may grow dependent on spo_Version *)
- END;
-
-
- CONST
- version - = 3;
-
- (* ^ DO NOT USE THIS DEFINE IN SOURCECODE ! *)
- (* AVOID INCREASING IT VIA RECOMPILATION ! *)
-
- objectTypeNone - = 0;
- objectTypeUnknown - = objectTypeNone;
- objectTypeIllegal - = 0FFFFFFFFH;
-
- objectTypeSample - = 1; (* Raw Sample *)
- objectTypeModule - = 2; (* Specific Sound Module *)
-
- (* There may be more types in the future : simply reject unknown types. *)
-
-
- (* ----------------------------------------------------------------------- *)
-
- TYPE (* Header of "SampleEntry"-List *)
- SampleList * = STRUCT(entryList *: e.List); (* List itself *)
- numEntries * : LONGINT; (* number of entries in List *)
- END;
-
-
- SampleEntry * = STRUCT(node*: e.Node) (* may e.g. contain SampleData *)
- (* the chaining Node *)
-
- version * : LONGINT; (* SPObject's Version (2) *)
- type * : LONGINT; (* Sample ? *)
-
- (* The following entries are only valid, if type is == typeSample *)
-
- sampleBuffer * : e.APTR; (* SampleData (CHIP-Ram) *)
- sampleSize * : LONGINT; (* size of SampleData in Bytes *)
-
- sampleBits * : LONGINT; (* 8, 16 *)
- samplesPerSec * : LONGINT; (* as needed with audio.device *)
- volume * : LONGINT; (* as needed with audio.device *)
-
- (* more entries may follow in the future *)
- END;
-
-
- CONST
- typeNone - = 0;
- typeUnknown - = typeNone;
- typeIllegal - = 0FFFFFFFFH;
-
- typeSample - = 1; (* Entry contains Sample Data *)
-
- (* There may be more types in the future : simply reject unknown types.
- Do not examine unknown SampleEntry-Types. They may contain data,
- which is structured different from the above in the future !
- *)
-
-
- (* This structure has to be passed to SPObject's SPO_CheckFileType()
- function, if media other than SPO_MEDIUM_DISK are used for reading.
- *)
-
- TYPE
- CheckFile * = STRUCT
- medium * : LONGINT; (* MEDIUM_... *)
- future * : LONGINT; (* as usual *)
- END;
- (* -----------------------------------------------------------------------*)
-
-
- (* An external support-library for the superplay.library is called a
- "spobject".
- Each spobject has to contain a "SPO_ObjectNode" structure (as follows)
- in its Library-Header, which later will be READ and MODIFIED by
- the superplay.library.
- Because the superplay.library supports three different sorts
- of SPObjects at the time (internal, independent and external),
- there are three different types of this structure (might be more in
- the future), which can be identified via their "spo_ObjectType".
- *)
-
- (* The Construction of a spobject :
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- The Library Base
- ----------------
- Version information: only the revision can be set freely
- (see structure described below)
-
- The Function Table
- ------------------
- (see <pragmas/spobjects.h>)
-
- *)
-
- (* *************************************************** *
- * * * *
- * * Library base Definition for spobjects * *
- * * * *
- * *************************************************** *)
-
- TYPE
- SPObjectBase - = STRUCT (libNode - : e.Library) (* Exec LibNode *)
- spObject* : ObjectNodePtr; (* POINTER to initialized *)
- (* SPO_ObjectNode *)
- (* Must be AllocVec()'ed, will be *)
- (* modified and delocated by *)
- (* superplay.library later. *)
- reserved*: ARRAY 32 OF LONGINT; (* Reserved for future expansion. *)
- (* Always NULL yet (Version 1). *)
-
- (*
- Private data of the spobject, not to be accessed
- by superplay.library, may follow.
- *)
- END;
-
- VAR
- base *: SPObjectBasePtr;
-
- END spObjects.
-